/*
 * Hyuga: A Density-Grid Stream Clustering Platform.
 * Copyright (C) 2014 PUC-Rio/Laboratory for Advanced Collaboration
 *
 * Hyuga is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Hyuga is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Hyuga.  If not, see <http://www.gnu.org/licenses/>.
 */
package br.pucrio.inf.lac.konoha.hyuga.events.semantics;

import br.pucrio.inf.lac.konoha.hyuga.events.cell.CellClusterEvent;
import br.pucrio.inf.lac.konoha.hyuga.events.grid.GridLogicalClusterEvent;

/**
 * Represent a dispersed grid cluster event caused by a given cell.
 * 
 * @author Marcos Roriz <mroriz@inf.puc-rio.br>
 */
public class DispersedGridClusterEvent {

    /** Dispersed cell index. */
    private int x;
    private int y;
    
    /** Dispersed Cluster */
    private GridLogicalClusterEvent cluster;
    private Object cluster2;
    
    public Object getCluster2() {
        return cluster2;
    }
    
    public void setCluster2(Object cluster2) {
        this.cluster2 = cluster2;
        this.cluster = (GridLogicalClusterEvent) cluster2;
    }
    
    /**
     * Empty Constructor
     */
    public DispersedGridClusterEvent() {}

    /**
     * Dispersed grid cluster, caused by cell <x, y>
     * 
     * @param x the dispersed cell x index
     * @param y the dispersed cell y index
     * @param the logical set of cell pair <x,y> that compose the dispersed cluster 
     */
    public DispersedGridClusterEvent(int x, int y, GridLogicalClusterEvent logicalCluster) {
        this.x = x;
        this.y = y;
        this.cluster = logicalCluster;
    }

    //////////////////////////////////////////////////////////////////////////
    // Gets and Sets
    //////////////////////////////////////////////////////////////////////////

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    public GridLogicalClusterEvent getCluster() {
        return cluster;
    }
    
    public void setCluster(GridLogicalClusterEvent cluster) {
        this.cluster = cluster;
    }
    
    @Override
    public String toString() {
        return "DISPERSED " + cluster + " CAUSED BY (" + x + ", " + y + ")";
    }
}
